/*
 * Created on 2007-2-18
 *
 * TODO 
 */
package jacky.lanlan.song.extension.struts.action;

import static org.easymock.EasyMock.*;

import org.apache.struts.upload.FormFile;
import org.apache.struts.validator.LazyValidatorForm;
import org.junit.Test;

/**
 * @author Jacky.Song
 *
 * 完整的上载过程测试。
 */
public class UploadTest_FullStack extends BaseStrutsActionTest {

	@Test
	public void testUpload() throws Exception {
		setRequestPathInfo("/POJOTest!upload");
		LazyValidatorForm form=registerActionForm(LazyValidatorForm.class);		
		for (int i = 0; i < 2; i++) {
			FormFile uploadingFile=createMock(FormFile.class);
			form.set("file"+i, uploadingFile);
		}

		actionPerform();
    
    verifyNoActionErrors();
    
    verifyInputForward();
    verifyForwardPath("/login.jsp");
	}

	@Override
	protected String getConfigLocation() {
		return "/config/struts/struts-config.xml";
	}
	
}
